home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2007 January
/
PCWorld_2007-01_cd.bin
/
v cisle
/
autoit
/
autoit-v3.2.0.1-setup.exe
/
Examples
/
Helpfile
/
_TicksToTime.au3
< prev
next >
Wrap
Text File
|
2006-06-17
|
857b
|
29 lines
; *** Demo to show a timer window
#include <GUIConstants.au3>
#include <Date.au3>
opt("TrayIconDebug",1)
Global $Secs, $Mins, $Hour, $Time
;Create GUI
GUICreate("Timer",120, 50)
GUICtrlCreateLabel("00:00:00", 10,10)
GUISetState()
;Start timer
$timer = TimerInit()
AdlibEnable("Timer", 50)
;
While 1
;FileWriteLine("debug.log",@min & ":" & @sec & " ==> before")
$msg = GUIGetMsg()
;FileWriteLine("debug.log",@min & ":" & @sec & " ==> after")
Select
Case $msg = $GUI_EVENT_CLOSE
Exit
EndSelect
Wend
;
Func Timer()
_TicksToTime(Int(TimerDiff($timer)), $Hour, $Mins, $Secs )
Local $sTime = $Time ; save current time to be able to test and avoid flicker..
$Time = StringFormat("%02i:%02i:%02i", $Hour, $Mins, $Secs)
If $sTime <> $Time Then ControlSetText("Timer", "", "Static1", $Time)
EndFunc ;==>Timer